https://discord.gg/botpress logo
has anyone found a solution to using a dynamic cli...
# 💻developers
p
has anyone found a solution to using a dynamic clientId in this example code so that the clientId does not need to be hardcoded? I have defined my client Id in a state and tried to pass it into const client = useClient({ clientId }); but it throws a conversation_creating error when i interact with the web chat mockup. import { Webchat, WebchatProvider, getClient } from '@botpress/webchat'; import { buildTheme } from '@botpress/webchat-generator'; /** * Build the theme object and stylesheet * The theme object and style can be generated using the
@botpress/webchat-generator
package * Style is a string that contains the CSS * Theme is an object that contains the theme configuration * Both of them can be exported to be used in the WebchatProvider */ const { style, theme } = buildTheme({ themeName: 'prism', themeColor: '#634433', }) export default function App() { const client = getClient({ clientId: '453254325-54325-435-345-345534253' }); return ( {style} ); }